<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
    xmlns:pm="http://primefaces.org/mobile"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
    
    <f:view renderKitId="PRIMEFACES_MOBILE" />    
    <h:head>        
        <ui:insert name="head" />
        <script type="text/javascript">
      		//<![CDATA[
	        function handleMessage(facesmessage) {
	            facesmessage.severity = 'info';
	 
	            //PF('growl').show([facesmessage]);
	            alert(facesmessage);
	            //console.log(facesmessage)
	        }
	      //]]>
        </script>
    </h:head>    
    <h:body>        
        <pm:page>            
            <pm:header title="Process-inbox">
            	<h:form id="fomHead">
            	<div class="ui-grid-a ui-btn-left" >
                <p:commandButton class="jqm-navmenu-link ui-nodisc-icon ui-alt-icon ui-btn ui-icon-bullets ui-btn-icon-notext ui-corner-all" 
                id="btnMenu" value="" type="button"/>
                 <p:commandButton class="jqm-navmenu-link ui-nodisc-icon ui-alt-icon ui-btn ui-icon-home ui-btn-icon-notext ui-corner-all" 
                id="btnMenu2" value="" type="submit" action="#{userController.send}" immediate="true"	/>
                 </div>
                
                
                <div class="ui-grid-a ui-btn-right">
                 <p:commandButton class="jqm-navmenu-link ui-nodisc-icon ui-alt-icon ui-btn ui-icon-search ui-btn-icon-notext ui-corner-all" 
               	 id="btnMenu3" value="" type="button"/>
                	<p:commandButton class="jqm-navmenu-link ui-nodisc-icon ui-alt-icon ui-btn ui-icon-plus ui-btn-icon-notext ui-corner-all" 
               	 id="btnMenu4" value=""  type="submit" action="#{processController.lstProceso}" immediate="true"/>
                
                </div>
                </h:form>
            </pm:header>
            
  
            
            <ui:insert name="content" />
            
        	<p:socket onMessage="handleMessage" channel="/inbox/#{userController.usuario}"/>
        	
            
            <p:overlayPanel for="fomHead:btnMenu" widgetVar="pnlMenu" at="left" showEffect="overlay">
            	<h4><h:outputText value="#{user.fullName}" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-user"></h:outputText> </h4>
          <h:form>
	            <p:menu >
	            	<p:submenu label="Recibidos" icon="ui-icon-comment">
		                <p:menuitem value="Bandeja de Entrada" action="#{bandejaController.cargarBandejaEntrada}" />
		                
		           		 <c:if test="#{user.isboss==true}">
		                	<p:menuitem value="Bandeja de Usuarios" action="#{bandejaController.cargarBandejaUsuarios}" />
		              	</c:if>		
		              	  <p:menuitem value="Solicitados" action="#{bandejaController.cargarBandejaSolicitado}" />              
		            </p:submenu> 
		             <p:submenu label="Otros">
		                <p:menuitem value="Borrador" action="#{bandejaController.cargarBandejaBorrador}" />
		                <p:menuitem value="Eliminados" action="#{bandejaController.cargarBandejaEliminados}" />
		             </p:submenu>
		              <p:submenu label="Cerrar">
		                <p:menuitem value="Cerrar Sesion" action="#{userController.cerrarSesion}" icon="ui-icon-action" />
		             </p:submenu>
	            </p:menu>
	            </h:form>
	        </p:overlayPanel>
            
            <pm:footer fixed="true" tapToggle="false">  
            	<h:outputLabel value="process-web-inbox"></h:outputLabel>
            </pm:footer>

        </pm:page>
        
       
        <script language="javascript">
           
        </script>
    </h:body>
    
</html>